package top.hudk.tank.factory;

import top.hudk.tank.config.ResourceMgr;
import top.hudk.tank.frame.AbstractGameFrame;
import top.hudk.tank.frame.TankFrame;
import top.hudk.tank.model.GameApplicationContext;

import java.awt.*;

/**
 * 作用：
 *
 * @author hudk
 * @date 2020/9/10 7:52
 */
public class DefaultExplode extends Explode{

    public DefaultExplode(){
        super();
    }

    @Override
    public void paint(Graphics g, AbstractGameFrame gameFrame) {
        g.drawImage(ResourceMgr.explodes[step++], getX(), getY(), null);
        if(step >= ResourceMgr.explodes.length){
            GameApplicationContext.getInstance().remove(this);
        }
    }
}
